<%@ page language="java" pageEncoding="utf-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri='/WEB-INF/taglib/Menu.tld' prefix='t'%>
<html>
	<head>
		<title>addHumanFile.jsp</title>
		<LINK href="/HR_Sys/css/Style.css" type=text/css rel=stylesheet>
		<LINK href="/HR_Sys/css/Manage.css" type=text/css rel=stylesheet>
		<script type='text/javascript'
			src='/HR_Sys/dwr/interface/JconfigFileBIZ.js'></script>
		<script type='text/javascript' src='/HR_Sys/dwr/engine.js'></script>
		<script type='text/javascript' src='/HR_Sys/dwr/util.js'></script>
		<script type="text/javascript"
			src="/HR_Sys/javascript/My97DatePicker/WdatePicker.js"></script>
		<script src='/HR_Sys/javascript/prototype.js'></script>
		<style>
			.cssnull{}
		</style>
		<script language="javascript" type="text/javascript">
	  	function second(){	  		
	  		var second=$("humanFile.firstKindId").value;
	  		JconfigFileBIZ.getConfigFileSecondKindList(second,showSecond);
	  	}
	  	function showSecond(data){
	  		var second=$("humanFile.secondKindId");								//获得二级机构下拉框对象
	  		//dwr.util.removeAllOptions(second);									//清空二级机构下拉框
	  		//dwr.util.addOptions(second,["---请选择---"]);							//填充二级下拉框
	  		second.options.length=1;
	  		
	  		var third=$("humanFile.thirdKindId");								//获得三级下拉框对象
	  		//dwr.util.removeAllOptions(third);									//清空三级下拉框
	  		//dwr.util.addOptions(third,["---请选择---"]);							//填充三级下拉框
	  		third.options.length=1;
	  		
	  		/**
	  		*@param second:填充的对象
	  		*@param data:填充的数据
	  		*@param secondKindId:option的value值
	  		*@param secondKindName:option的display值
	  		**/								
	  		dwr.util.addOptions(second,data,"secondKindId","secondKindName");
	  	}
	  	
	  	function third(){
	  		var third=$("humanFile.secondKindId").value;
	  		JconfigFileBIZ.getConfigFileThirdKindList(third,showThird);	  	
	  	}
	  	
	  	function showThird(data){
	  		var third=$("humanFile.thirdKindId");								//获得下拉框对象
	  		//dwr.util.removeAllOptions(third);									//晴空下拉框
	  		//dwr.util.addOptions(third,["---请选择---"]);							//填充下拉框
	  		third.options.length=1;
	  		
	  		/**
	  		*@param third:填充的对象
	  		*@param data:填充的数据
	  		*@param thirdKindId:option的value值
	  		*@param thirdKindName:option的display值
	  		**/								
	  		dwr.util.addOptions(third,data,"thirdKindId","thirdKindName");
	  	}
	  	
	  	function configMajor(){
	  		var major=$("humanFile.humanMajorKindId").value;	  		
	  		JconfigFileBIZ.getConfigMajorList(major,showConfigMajor);	  			  	
	  	}
	  	
	  	function showConfigMajor(data){	  	  	
	  		var major=$("humanFile.humanMajorId");
	  		//dwr.util.removeAllOptions(major);
	  		//dwr.util.addOptions(major,['---请选择---']);
	  		major.options.length=1;
	  		dwr.util.addOptions(major,data,'majorId','majorName');	  		
	  	}
	  	
		function doSubmit(){
			//提交时填充一级机构名称到隐藏表单域中
			$("humanFile.firstKindName").value=dwr.util.getText($("humanFile.firstKindId"));
			
			//提交时填充二级机构名称到隐藏表单域中
			$("humanFile.secondKindName").value=dwr.util.getText($("humanFile.secondKindId"));
			
			//提交时填充三级机构名称到隐藏表单域中
			$("humanFile.thirdKindName").value=dwr.util.getText($("humanFile.thirdKindId"));
			
			//提交时填充职位分类到隐藏表单域中
			$("humanFile.humanMajorKindName").value=dwr.util.getText($("humanFile.humanMajorKindId"));
			
			
			//提交时填充职位分类到隐藏表单域中
			$("humanFile.humanMajorKindName").value=dwr.util.getText($("humanFile.humanMajorKindId"));
			
			//提交时填充职位名称到隐藏表单域中
			$("humanFile.humanMajorName").value=dwr.util.getText($("humanFile.humanMajorId"));
			
			document.forms[0].submit();					
		}		
	  </script>
	  
	  <script type="text/javascript">
	  	function testfocus(ele){
    //alert('focus');
	    	var borderColor = ele.currentStyle ?
	                          ele.currentStyle.borderColor :
	                          document.defaultView.getComputedStyle(ele, null)['borderColor'];
	        ele.style.borderColor = '#ff9900';
	        ele.onkeyup = function () {
	            this.style.borderColor = borderColor;
	        }
	  	}
	  	
	  	function restore(obj){
	  		//alert('restore');
	  		obj.style.cssText='width: 100%';
	  	}
	  </script>
	  
	  <script type="text/javascript">
	  	function PreviewImg(obj)
	  	{
	  		var img=document.getElementById('person');
	  		img.src=obj.value;
	  	}
	  
	  </script>
	  
	</head>
	
	<body>
		<div style="height: 30px; border: solid 1px blue;">
			${user.trueName},欢迎光临！
			<font color="white">${user.name}:${user.id }</font>${params.path}
		</div>
		<div style="border: solid 1px red; height: 100%;">
			<div
				style="height: 100%; width: 180px; border: solid 1px blue; float: left;">
				<t:menu dataSource="menus" width="180"
					iconPath="/icon.do?op=showIcon&icon.id=" colIdName="menuId"
					colParentIdName="menuUpId" colTitleName="menuTitle"
					colSrcName="menuSrc" colIconName="menuPic">${user.id }</t:menu>
			</div>
			<div style="height: 100%; width: 100%; border: solid 1px blue;">
	<form method="POST" action="/HR_Sys/humanFile.do?op=addHumanFile">
		<!-- 头部色块 -->
		<table cellSpacing='0' cellPadding='0' width="98%" border='0'>
		  	<tbody>
		  	<tr>
				<td width="15"><IMG src="/HR_Sys/images/new_019.jpg" border="0"></td>
			    <td width="100%" background="/HR_Sys/images/new_020.jpg" height="20"></td>
			    <td width="15"><IMG src="/HR_Sys/images/new_021.jpg" 
			  	border="0"></td></tr>
		  	</tbody>
	  	</table> 
	  	<!-- 头部色块结束 --> 

		<!-- 中部开始 -->
		<table cellSpacing='0' cellPadding='0' width="98%" border='0'>
			<tbody>
			<tr>
				<!-- 第一列 -->
				<td width='15' background="/HR_Sys/images/new_022.jpg">
					<IMG src="/HR_Sys/images/new_022.jpg" border='0'>
				</td>
				<!-- 第一列结束 -->

				<!-- 第二列 -->
				<td  vAlign="top" width="100%" bgColor="#ffffff">
					<table cellSpacing='0' cellPadding='5' width="100%" border='0'>
						<tr>
							<td class='manageHead'>当前位置：管理首页 &gt; 人力资源档案管理 &gt; 登记</td>
						</tr>			
						<tr>
							<td height='2'></td>
						</tr>
					</table>
					<br>
					
					<!-- 中间表格开始 -->
					<table borderColor='#eeeeee' cellSpacing='0' cellPadding='0' width="100%" align='center' border='0'>
						<tbody>
						<tr>
							<td>							
								<!-- table实体开始 -->
								<table width="100%" style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid;  BORDER-LEFT: #cccccc 1px solid; COLOR: #000000; BORDER-BOTTOM: #cccccc 1px solid; " height="100%">
									<tr style="BACKGROUND-COLOR: #eeeeee; ">
										<td width="72">I级机构</td>
										<td width="125px">
											<c:choose>
									    		<c:when test="${empty requestScope.humanFileForm.configFileFirstKindList}">
									    			<jsp:forward page="/humanFile.do?op=ToAddHumanFile"/>
									    		</c:when>
									    		<c:otherwise>
									    			<select name="humanFile.firstKindId" onchange="second()" style="width:100%;" onfocus="javaScript:testfocus(this);">
									    				<option value="0">---请选择---</option>
									    				<c:forEach var='first' items="${requestScope.humanFileForm.configFileFirstKindList}">
									    					<option value="${first.firstKindId }">${first.firstKindName }</option>
									    				</c:forEach>
									    			</select>
									    			<input type="hidden" name="humanFile.firstKindName"></input>
									    		</c:otherwise>
									    	</c:choose>
										</td>
										
										<td width="72">II级机构</td>
										<td width="125px">
											<select name="humanFile.secondKindId" onchange="third()" style="width: 100%">
												<option value="0">---请选择---</option>
											</select>
											<input name="humanFile.secondKindName" type="hidden"></input>
										</td>
										<td width="72">III级机构</td>
										<td colspan="2">
											<select name="humanFile.thirdKindId" style="width: 100%">
												<option value="0">---请选择---</option>
											</select>
											<input name="humanFile.thirdKindName" type="hidden"></input>
										</td>
										<td rowspan="5">
											<img name='persion' id='person'  src='/HR_Sys/psersonImages/default_person.gif' width='100%' height='100%' >
										</td>
									</tr>
									<tr>
										<td>职位分类</td>
										<td>
											<select name="humanFile.humanMajorKindId" onchange="configMajor()" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="majorKind" items="${requestScope.humanFileForm.configMajorKindList}">
													<option value="${majorKind.majorKindId }">${majorKind.majorKindName }</option>
												</c:forEach>
											</select>
											<input name="humanFile.humanMajorKindName" type="hidden">
										</td>
										<td>职位名称</td>
										<td>
											<select name="humanFile.humanMajorId" style="width: 100%;">
												<option value="0">---请选择---</option>
											</select>
											<input name="humanFile.humanMajorName" type="hidden">
										</td>
										<td>职称</td>
										<td colspan="2">
											<select name="humanFile.humanProDesignation" style="width: 100%;">
												<option value="0">---请选择---</option>
													<c:forEach var="proDesignation" items="${requestScope.humanFileForm.humanProDesignationList}">
														<option value="${proDesignation.attributeName }">${proDesignation.attributeName }</option>
													</c:forEach>
											</select>
										</td>
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>姓名</td>
										<td><input type="text" id="name" name="humanFile.humanName" style="width: 100%;height:100%;" onfocus="javaScript:testfocus(this);" onblur="restore(this)"/></td>
										<td>性别</td>
										<td>
											<select name="humanFile.humanSex" style="width: 100%">
												<option value="0">---请选择性别---</option>
												<option value="男">男</option>
												<option value="女">女</option>
											</select>
										</td>
										<td>Email</td>
										<td colspan="2"><input type="text" name="humanFile.humanEmail" style="width: 100%" /></td>
									</tr>
									<tr>
										<td>电话</td>
										<td><input type="text" name="humanFile.humanTelephone" style="width: 100%" /></td>
										<td>QQ</td>
										<td><input type="text" name="humanFile.humanQq" style="width: 100%" /></td>
										<td>手机</td>
										<td colspan="2"><input type="text" name="humanFile.humanMobilephone" style="width: 100%" />														</td>
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>住址</td>
										<td colspan="3"><input type="text" name="humanFile.humanAddress" style="width: 100%" /></td>
										<td>邮编</td>
										<td colspan="2"><input type="text" name="humanFile.humanPostcode" style="width: 100%" /></td>
									</tr>
									<tr>
										<td>国籍</td>
										<td>
											<select name="humanFile.humanNationality" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="nation" items="${requestScope.humanFileForm.humanNationalityList}">
												<option value="${nation.attributeName }">${nation.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td width="72">出生地	</td>
										<td><input type="text" name="humanFile.humanBirthplace" style="width: 100%" /></td>
										<td>生日</td>
										<td width="115px"><input type="text" name="humanBirthday" style="width: 100%" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate" /></td>
										<td width="72">民族</td>
										<td>
											<select name="humanFile.humanRace" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="race" items="${requestScope.humanFileForm.humanRaceList}">
												<option value="${race.attributeName }">${race.attributeName }</option>
												</c:forEach>
											</select>
										</td>
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>宗教信仰</td>
										<td>
											<select name="humanFile.humanReligion" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="religion" items="${requestScope.humanFileForm.humanReligionList}">
												<option value="${religion.attributeName }">${religion.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td>政治面貌</td>
										<td>
											<select name="humanFile.humanParty" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="party" items="${requestScope.humanFileForm.humanPartyList}">
												<option value="${party.attributeName }">${party.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td>身份证号</td>
										<td><input type="text" name="humanFile.humanIdCard" style="width: 100%" /></td>
										<td>社会保障号码</td>
										<td><input type="text" name="humanFile.humanSocietySecurityId" style="width: 100%" /></td>
									</tr>
									<tr>
										<td>年龄</td>
										<td><input type="text" name="humanFile.humanAge" style="width: 100%" /></td>
										<td>学历</td>
										<td>
											<select name="humanFile.humanEducatedDegree" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="educatedDegree" items="${requestScope.humanFileForm.humanEducatedDegreeList}">
												<option value="${educatedDegree.attributeName }">${educatedDegree.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td>教育年限</td>
										<td>
											<select name="humanFile.humanEducatedYears" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="educatedYears" items="${requestScope.humanFileForm.humanEducatedYearsList}">
												<option value="${educatedYears.attributeName }">${educatedYears.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td>专业	</td>
										<td>
											<select name="humanFile.humanEducatedMajor"	style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="major" items="${requestScope.humanFileForm.humanEducatedMajorList}">
												<option value="${major.attributeName }">${major.attributeName }</option>
												</c:forEach>
											</select>			
										</td>
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>薪酬标准</td>
										<td>
											<select name="humanFile.salaryStandard"	style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="salaryStandard"	items="${requestScope.humanFileForm.salaryStandardList}">
												<option value="${salaryStandard.standardId }">${salaryStandard.standardName }</option>
												</c:forEach>
											</select>
											<input type="hidden" name="salaryStandard.standardName">
										</td>
										<td>开户行</td>
										<td><input type="text" name="humanFile.humanBank" style="width: 100%" /></td>
										<td>帐号</td>
										<td><input type="text" name="humanFile.humanAccount" style="width: 100%" /></td>
										<td>登记人</td>
										<td><input type="text" value="${sessionScope.user.name }" readonly="readonly" style="width: 100%" />
											<input type="hidden" name="humanFile.register" value="${sessionScope.user.id }" />
										</td>
									</tr>
									<tr>
											<!--td>建档时间</td><td><input type="text" name="humanFile.registTime" style="width:100%"/></td-->
										<td>特长</td>
										<td>
											<select name="humanFile.humanSpeciality" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="speciality"	items="${requestScope.humanFileForm.humanSpecialityList}">
												<option value="${speciality.attributeName }">${speciality.attributeName }											</option>
												</c:forEach>
											</select>
										</td>
										<td>爱好</td>
										<td>
											<select name="humanFile.humanHobby" style="width: 100%;">
												<option value="0">---请选择---</option>
												<c:forEach var="hoppy" items="${requestScope.humanFileForm.humanHobbyList}">
												<option value="${hoppy.attributeName }">${hoppy.attributeName }</option>
												</c:forEach>
											</select>
										</td>
										<td> 选择图片：</td>
										<td colspan='3'><input type="file" size="20" onchange="javascript:PreviewImg(this);" /></td>
										
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>个人履历</td>
										<td colspan="7"><textarea name="humanFile.humanHistroyRecords" style="width: 100%"></textarea></td>
									</tr>
									<tr>
										<td>家庭关系</td>
										<td colspan="7"><textarea name="humanFile.humanFamilyMembership" style="width: 100%"></textarea></td>
									</tr>
									<tr style="BACKGROUND-COLOR: #eeeeee;">
										<td>备注</td>
										<td colspan="7"><textarea name="humanFile.remark" style="width: 100%"></textarea></td>
									</tr>
								</table>
								<!-- table实体结束 -->			
								</td>
							</tr>
							<tr>
								<td colspan="8" bgcolor="#ffffff">
									<div style="width: 100%" align="right">
									<input type="button" value="提交" onclick="doSubmit()" />
									<input type="reset" value="重置" />
									</div>
								</td>
							</tr>
						</tbody>
					</table>		
					<!-- 中间表格结束 -->
				</td>
				<!-- 第二列结束 -->

				<!-- 第三列 -->
				<td width='15' background="/HR_Sys/images/new_023.jpg">
					<IMG src="/HR_Sys/images/new_023.jpg" border='0'>
				</td>
				<!-- 第三列结束 -->
			</tr>
		</tbody>
	</table>
	<!-- 中部结束 -->

	<!-- 底部色块开始 -->
    <table cellSpacing='0' cellPadding='0' width="98%" border='0'>
	  <tbody>
		  <tr>
		    <td width="15"><IMG src="/HR_Sys/images/new_024.jpg" border="0"></td>
		    <td align="middle" width="100%" background="/HR_Sys/images/new_025.jpg" height="15"></td>
		    <td width="15"><IMG src="/HR_Sys/images/new_026.jpg" border="0"></td>
		  </tr>
	  </tbody>
  	</table>
  	<!-- 底部色块结束 -->			
	</form>
			</div>
		</div>
		<div style="height: 30px; border: solid 1px blue;">
		</div>
	</body>
</html>
